package com.liuc.mybatis;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Semaphore;

public class CountLauch {
    public static void main(String[] args) throws InterruptedException {

      CountDownLatch countDownLatch = new CountDownLatch(6);
      for(int i=1; i<=6; i++){

          new Thread(() ->{
              System.out.println(Thread.currentThread().getName()+"\t离开");
              countDownLatch.countDown();
          },String.valueOf(i)).start();
      }
        countDownLatch.await();
        System.out.println(Thread.currentThread().getName()+"\t班长离开");
    }
}
